<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<jsp:include page="../common/nav.jsp"></jsp:include>
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="col-lg-12">
		<ul class="nav nav-tabs">
			<li><a class="nav-link active" data-toggle="tab" href="#stab" onclick="getsubTab()">采购申请</a></li>
			<li><a class="nav-link" data-toggle="tab" href="#mtab" onclick="getMainTab()">采购计划</a></li>
		</ul>
		<div id="tabDiv" class="tab-content"></div>
	</div>
</div>
<script>

	$(function() {
		getsubTab();
	});

	// 获取采购计划列表
	function getMainTab(data){
		$.ajax({
			type: "post",
			url: "web/purchasingAudit/getMainPageList",
			data : data,
			async: false,
			cache: false,
			success: function(data){
				if(data != ""){
					$("#tabDiv").html(data);
					$("#mtab").addClass("active");
				}
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){
				redragonJS.alert(textStatus);
			}
		});
	}

	// 获取采购申请列表
	function getsubTab(data){
		$.ajax({
			type: "post",
			url: "web/purchasingAudit/getSubPageList",
			data : data,
			async: false,
			dataType: "html",
			cache: false,
			success: function(data){
				if(data != ""){
					$("#tabDiv").html(data);
					$("#stab").addClass("active");
				}
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){
				redragonJS.alert(textStatus);
			}
		});
	}
</script>